package com.itheima.service.impl;

import com.itheima.dao.StudentDao;
import com.itheima.domain.Student;
import com.itheima.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 王加鑫
 * @Date 2021/7/23 21:33
 * @Since JDK 1.9
 */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao dao;

    public void save(Student student) {
        dao.save(student);
    }

    public void update(Student student) {
        dao.update(student);
    }

    public void delete(Integer id) {
        dao.delete(id);
    }

    public Student findById(Integer id) {

        return dao.findById(id);
    }

    public List<Student> findAll() {
        return dao.findAll();
    }

    public Student findByName(String name) {
        return dao.findByName(name);
    }
}
